<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
    <title>小米登陆例子</title>
    <style>
        *{margin:0px;padding:0px}
        .table{
            text-align: center;
            width:400px;
            border: 1px solid #333;
        }
        .active{
            color:orangered;
        }
        input{
            width:80%;
            height:40px;
            margin-top: 20px;
        }
        li{
            list-style: none;
            display: inline-block;
            cursor: pointer;
            margin-right: 50px;
        }
        .content{
            height:400px;
            position:relative;
        }
        .nav{
            height:50px;
            line-height: 50px;
            border-bottom: 1px soild #333;
        }
        .content>div{
            position:absolute;
            width:100%;
            height: 100%;
            left:0;
            top: 0;
        }
        .saoma{
            display: none;
        }
        img{
            margin-top: 20px;
        }
    </style>
</head>
<body>
    <div class="table">
        <ul class="nav">
            <li class="active">账号登陆</li>
            <li>扫码登陆</li>
        </ul>
        <div class="content">
            <div class="account">
                <form action="">
                    <p><input type="text " placeholder="请输入用户名"></p>
                    <p><input type="text" placeholder="请输入密码"></p>
                    <p><input type="submit" value="登陆"></p>
                </form>
            </div>
            <div class="saoma">
                <img src="images/erweima.png" alt="">
            </div>
        </div>
    </div>
    <script>
    $("li").click(function(){
        $(this).addClass("active").siblings().removeClass("active")
        // console.log($(this).index())
        $(".content>div").eq($(this).index()).show().siblings().hide()
   })
    </script>
</body>
</html>